package com.farewell.blog.pojo;


import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @author Farewell
 * @date 2021/2/1
 * <p>
 * 博客实体类
 */
@Data
@TableName("t_blog")
public class Blog implements Serializable {
    @TableId(type = IdType.ID_WORKER)
    private Long id;
    private String title;
    private String content;
    @TableField("first_picture")
    private String firstPicture;
    private String flag;
    private Integer views;
    private boolean appreciation;
    private boolean shareStatement;
    private boolean commentabled;
    private boolean published;
    private boolean recommend;
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @TableField("type_id")
    private long typeId;
    @TableField(exist = false)
    private List<Tag> tagList;
    @TableField(exist = false)
    private String typeName;
    private String description;
    @TableField(exist = false)
    private Long checkId;

    public Blog() {
    }

    public Blog(Long id) {
        this.id = id;
    }

    public Blog(Long id, String title, String content, String firstPicture, String flag, Integer views, boolean appreciation, boolean shareStatement, boolean commentabled, boolean published, boolean recommend, Date createTime, Date updateTime, long typeId, List<Tag> tagList, String typeName, String description) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.firstPicture = firstPicture;
        this.flag = flag;
        this.views = views;
        this.appreciation = appreciation;
        this.shareStatement = shareStatement;
        this.commentabled = commentabled;
        this.published = published;
        this.recommend = recommend;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.typeId = typeId;
        this.tagList = tagList;
        this.typeName = typeName;
        this.description = description;
    }
}
